<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="../../Build/react.development.js"></script>
    <script src="../../Build/react-dom.development.js"></script>
    <script src="../../Build/babel.min.js"></script>
  </head>
  <body>
    <div id="app"></div>
    <script type="text/babel">
      class MyComponent extends React.Component {
        constructor(props) {
          super(props);
          this.myTextInput = React.createRef();
          this.handleClick = this.handleClick.bind(this)
        }
        handleClick () {
          this.myTextInput.current.focus();
        }
        render () {
          return(
            <div>
              <input type="text" ref={this.myTextInput}/>
              <input type="button" value="Focus the text input" onClick={this.handleClick} />
            </div>
          )
        }
      }
      ReactDOM.render(
        <MyComponent/>,
        document.getElementById('app')
      )
    </script>
  </body>
</html>